//
//  TTIAudioPickerManager.h
//  iOSCodeProject
//
//  Created by Fox on 14-7-18.
//  Copyright (c) 2014年 翔傲信息科技（上海）有限公司. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import <MediaPlayer/MediaPlayer.h>

typedef void(^TTIAudioPickerManagerCompleteBlock)(NSString *resultPath, NSString *orignPath);
typedef void(^TTIAudioPickerManagerFailedBlock)(NSError *error);

typedef NS_ENUM(NSInteger, TTIAudioPickerManagerType) {
    TTIAudioPickerManagerBoth = 0,             //通过录音和选择音频获取
    TTIAudioPickerManagerRecord = 1,           //通过录音获取音频
    TTIAudioPickerManagerAlbum = 2             //通过系统专辑获取音频
};

/**
 *  音频选择器：录制音频和拍摄音频
 */
@interface TTIAudioPickerManager : NSObject <UIActionSheetDelegate,MPMediaPickerControllerDelegate>

/**
 *  创建单例对象
 *
 *  @return 单例对象
 */
+ (TTIAudioPickerManager *)shareInstance;

/**
 *  选择音频
 *
 *  @param styleType      类型
 *  @param delegate       委托
 *  @param isConcertMP3   是否转换为MP3
 *  @param complete_Block 完成的回调
 *  @param failed_Block   失败的回调
 */
- (void)audioPickerWithType:(TTIAudioPickerManagerType )styleType
               withDelegate:(id )delegate
               isConvertMP3:(BOOL)isConcertMP3
               comleteBlock:(TTIAudioPickerManagerCompleteBlock )completeBlock
                 failedBloc:(TTIAudioPickerManagerFailedBlock)failedBlock;

@end
